package lte

import "gitee.com/thubcc/mobile/utils"

type ChestDL struct {
	Cid    int `json:"id"`
	TxPort int `json:"txport"`
	tdch   []complex128
	Peak   int     `json:"pos"`
	Amp    float64 `json:"amp"`
}

func (c *ChestDL) GetCh() []complex128 {
	return c.tdch
}
func (c *ChestDL) Done(rxSymbols utils.Array3) {
	tab := lazyTable.Get(c.Cid, c.TxPort)
	c.tdch = tab.H(rxSymbols)
	c.Peak, c.Amp = utils.CAbsMax1D(c.tdch)
}

func ChannelEstimateDL(rxSymbols utils.Array3, cid, txp int) *ChestDL {
	r := &ChestDL{Cid: cid, TxPort: txp}
	r.Done(rxSymbols)
	return r
}
